<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .error{
            color:red;
        }
    </style>
</head>
<body>
    <div id="app">
            {{username}}
            <div>数量{{num.toFixed(2)}}</div>
            <div>价格{{(price*1).toFixed(2)}}</div>
            <div>小计 {{num * price}}</div>
            <div>小计 {{(num * price).toFixed(2)}}</div>
    </div>
   
</body>
<script>
    new  Vue({
        el:"#app",
        data:{
            username:"leson",
            num:10,
            price:"9"
        }
    })

    


</script>
</html>